import { useEffect, useState } from 'react'

export default function useAllStudents() {

    const [list,] = useState([
        {
            name: '张三',
            id: '101',
            age: 21
        },
        {
            name: '李四',
            id: '102',
            age: 26
        }
    ])

    const getList = () => {
        // axios.get('http://localhost:5000/students').then(res => {
        //     setList(res.data)
        // })
        console.log('调用接口');
    }

    useEffect(() => {
        getList()
    }, [])

    return [list, getList]
}
